home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Oct 89 / Z0144-Palette Problems (L-Oct89 < prev    next >
Encoding:
Text File  |  1989-10-20  |  3.7 KB  |  150 lines  |  [TEXT/GEOL]

  1. Item    6842971                         20-Oct-89        09:42
  2.  
  3. From:   D1220                           Vari-Lite, Andy Meldrum,PRT
  4.  
  5. To:     MACAPP.TECH$                    MACAPP Tech
  6.  
  7. Sub:    Palette Problems (Long!!)
  8.  
  9. I have a subclass of TWindow, TColBkWindow, where I install a colored
  10. pixelpattern using the BackPicPat Call. This works fine, & I get the (grey)
  11. background I want. The window itself is created from a resource description in
  12. ..makeViews, like this :
  13.  
  14.    SELF.fWindow := NewTemplateWindow(kVisWindowID, SELF);
  15. { The resource description says the Window is of class TColBkWindow; }
  16.  
  17.  
  18. Here is the IRes for TColBkWindow :
  19.  
  20.  Procedure TColBkWindow.IRes (itsDocument: TDocument; itsSuperView: TView; Var
  21. itsParams: Ptr);
  22.   Override;
  23.    { set bkPixPat if we get read in from a resource }
  24.  
  25.  Begin
  26.   Inherited IRes(itsDocument, itsSuperView, itsParams);
  27.   SELF.SetBkPat;
  28.  End;
  29.  
  30.  
  31. Here is the guts of SetBkPat :
  32.  
  33.   If gConfiguration.HasColorQd Then
  34.    Begin
  35.     fBkPat := GetPixPat(kBkPat);   { Load the penpat }
  36.     If fBkPat <> Nil Then  { If we get something back }
  37.      Begin
  38.    { Make sure we set our ports bkPat !! }
  39.       GetPort(thePort);
  40.       SetPort(SELF.GetGrafPort);
  41.       BackPixPat(fBkPat);  { Install into cGrafPort }
  42.       SetPort(thePort);
  43.      End;
  44.    End;
  45.  
  46.  
  47. The problem I am having is that when I bring up the color picker the background
  48. pattern that I have set changes color for the duration that the picker is up.
  49. However, this is dependent on which background pattern I use. Below are two
  50. patterns I have tried. "Color Changing" is the one that changes color when I
  51. bring up the picker with the the (Apple) Video Card in 256 color mode. "Non
  52. Color Changing" stays the correct color when I bring the picker up with the
  53. Video Card in 256 colormode. However, this pattern too will change color if I
  54. set the Video Card to 16 color mode.
  55.  
  56. Here are two patterns  derezzed
  57. resource 'ppat' (1001, "Color Changing", purgeable) {
  58.    newPattern,
  59.    $"AA 55 AA 55 AA 55 AA 55",
  60.    4,
  61.    {0, 0, 8, 8},
  62.    0,
  63.    unpacked,
  64.    0,
  65.    0x480000,
  66.    0x480000,
  67.    chunky,
  68.    4,
  69.    1,
  70.    4,
  71.    0,
  72.    $"77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77"
  73.    $"77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77",
  74.    0x81,
  75.    0,
  76.    {   /* array ColorSpec: 8 elements */
  77.    /* [1] */
  78.    0, 65535, 65535, 65535,
  79.    /* [2] */
  80.    1, 0, 0, 0,
  81.    /* [3] */
  82.    2, 38615, 30225, 15517,
  83.    /* [4] */
  84.    3, 55980, 12316, 12316,
  85.    /* [5] */
  86.    4, 65535, 62591, 9186,
  87.    /* [6] */
  88.    5, 65535, 52370, 37885,
  89.    /* [7] */
  90.    6, 65535, 32767, 0,
  91.    /* [8] */
  92.    7, 40960, 40960, 40960
  93.    }
  94. };
  95.  
  96. resource 'ppat' (1000, "Non Color Changing", purgeable) {
  97.    newPattern,
  98.    $"AA 55 AA 55 AA 55 AA 55",
  99.    4,
  100.    {0, 0, 8, 8},
  101.    0,
  102.    unpacked,
  103.    0,
  104.    0x480000,
  105.    0x480000,
  106.    chunky,
  107.    4,
  108.    1,
  109.    4,
  110.    0,
  111.    $"77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77"
  112.    $"77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77",
  113.    0x81,
  114.    0,
  115.    {   /* array ColorSpec: 8 elements */
  116.    /* [1] */
  117.    0, 65535, 65535, 65535,
  118.    /* [2] */
  119.    1, 0, 0, 0,
  120.    /* [3] */
  121.    2, 38615, 30225, 15517,
  122.    /* [4] */
  123.    3, 55980, 12316, 12316,
  124.    /* [5] */
  125.    4, 65535, 62591, 9186,
  126.    /* [6] */
  127.    5, 65535, 52370, 37885,
  128.    /* [7] */
  129.    6, 65535, 32767, 0,
  130.    /* [8] */
  131.    7, 49152, 49152, 49152
  132.    }
  133. };
  134.  
  135.  
  136. I created the 'ppat' by editing the desktop pattern till I got what I wanted &
  137. then copying the ppat resource from the system.
  138.  
  139. My question is (finally !! ) .. what is going on. Can someone explain exactly
  140. why I am seeing what I am. Also ( two questions for the price of one here !! )
  141. can I stop the bkColor changing when the picker is active !! Any & all
  142. suggestions gratefuly recieved.
  143.  
  144. I am doing all of the above on a MacII with QD32 installed, running System
  145. 6.0.3.
  146.  
  147. Andy.
  148.  
  149.  
  150.